<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item :label="$t('商户信息')">
              <a-input :placeholder="$t('请输入商户编码/名称')" v-model="queryParam.supplierInfo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">{{$t('查询')}}</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('重置')}}</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    
    <!-- 操作按钮区域 -->
    <div class="table-operator">
    </div>

    <!-- table区域-begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">{{$t('查看账单')}}</a>
        </span>

      </a-table>
    </div>

    <bis-diff-check-out-modal ref="modalForm" @ok="modalFormOk"/>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import BisDiffCheckOutModal from './modules/BisDiffCheckOutModal'
  import '@/assets/less/TableExpand.less'

  export default {
    name: "BisDiffCheckOutList",
    mixins:[JeecgListMixin],
    components: {
      BisDiffCheckOutModal
    },
    data () {
      return {
        description: '异业结账单管理页面',
        // 表头
        columns: [
          {
            title:this.$t('商户编码'),
            align:"center",
            dataIndex: 'supplierCode'
          },
          {
            title:this.$t('商户名称'),
            align:"center",
            dataIndex: 'supplierName'
          },
          {
            title:this.$t('账目开始时间'),
            align:"center",
            dataIndex: 'startTime'
          },
          {
            title:this.$t('结账时间'),
            align:"center",
            dataIndex: 'createTime'
          },
          {
            title:this.$t('结账人'),
            align:"center",
            dataIndex: 'createBy'
          },
          {
            title: this.$t('操作'),
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/diffcheckout/bisDiffCheckOut/list",
          delete: "/diffcheckout/bisDiffCheckOut/delete",
          deleteBatch: "/diffcheckout/bisDiffCheckOut/deleteBatch",
          exportXlsUrl: "/diffcheckout/bisDiffCheckOut/exportXls",
          importExcelUrl: "diffcheckout/bisDiffCheckOut/importExcel",
          
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'supplierCode',text:'商户编码',dictCode:''})
        fieldList.push({type:'string',value:'supplierName',text:'商户名称',dictCode:''})
        fieldList.push({type:'datetime',value:'startTime',text:'账目开始时间'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>